// 左边导航栏组件
<template>
  <div>
    <el-menu
      default-active="/doctor"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#0c6785"
      text-color="#fff"
      active-text-color="#fff"
      router
      :collapse="isCollapse"
    >
      <!-- 首页导航 -->
      <el-menu-item>
        <span slot="title" style="font-size:20px">医护系统</span>
      </el-menu-item>
      <el-menu-item index="/doctor">
        <i class="el-icon-menu"></i>
        <span slot="title">个人信息维护</span>
      </el-menu-item>
      <el-menu-item index="/doctor/doctorDiagnosis">
        <i class="el-icon-menu"></i>
        <span slot="title">医生诊断</span>
      </el-menu-item>
      <!-- 展示所有数据 -->
      <el-menu-item index="/doctor/doctorSchedule">
        <i class="el-icon-setting"></i>
        <span slot="title">医生排班</span>
      </el-menu-item>
    <!-- 下拉导航 -->
    <el-submenu index="3">
      <template slot="title">
        <i class="el-icon-location"></i>
        <span>预留下拉框扩展</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="1-1">占位符</el-menu-item>
        <el-menu-item index="1-2">占位符</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
    </el-menu>
  </div>
</template>
<script>
export default {
  //调用父类的变量
  props:['isCollapse'],
  data() {
    return {
      // isCollapse: true
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style lang='less' scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }
</style>
